Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cpp-linter action #199

Merged
merged 50 commits into from
Mar 8, 2023
Merged

Add cpp-linter action #199

merged 50 commits into from
Mar 8, 2023

Conversation

hillmich
Copy link
Contributor

@hillmich hillmich commented Mar 1, 2023

Somehow I forgot this previously.

In addition:

@hillmich hillmich added the enhancement Anything related to improvements of the existing library label Mar 1, 2023
@hillmich hillmich self-assigned this Mar 1, 2023
@hillmich hillmich marked this pull request as draft March 1, 2023 12:50
@codecov
Copy link

codecov bot commented Mar 1, 2023

Codecov Report

Merging #199 (b3be5b8) into main (f6f29a3) will increase coverage by 7.4%.
The diff coverage is 98.6%.

@@           Coverage Diff           @@
##            main    #199     +/-   ##
=======================================
+ Coverage   87.7%   95.1%   +7.4%     
=======================================
  Files         20      20             
  Lines       2095    1939    -156     
  Branches     370     344     -26     
=======================================
+ Hits        1838    1845      +7     
+ Misses       257      94    -163     
Impacted Files Coverage Δ
include/UnitarySimulator.hpp 100.0% <ø> (ø)
src/DeterministicNoiseSimulator.cpp 94.2% <84.6%> (-0.8%) ⬇️
src/PathSimulator.cpp 89.0% <86.3%> (ø)
include/Simulator.hpp 92.3% <94.4%> (ø)
src/Simulator.cpp 96.5% <98.9%> (+<0.1%) ⬆️
include/CircuitSimulator.hpp 100.0% <100.0%> (ø)
include/DeterministicNoiseSimulator.hpp 100.0% <100.0%> (ø)
include/GroverSimulator.hpp 96.4% <100.0%> (-0.2%) ⬇️
include/HybridSchrodingerFeynmanSimulator.hpp 86.3% <100.0%> (-0.6%) ⬇️
include/PathSimulator.hpp 92.7% <100.0%> (+4.8%) ⬆️
... and 16 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

src/ShorFastSimulator.cpp Fixed Show fixed Hide fixed
src/ShorFastSimulator.cpp Fixed Show fixed Hide fixed

std::ifstream v1_stream(vector1);
std::ifstream v2_stream(vector2);
std::ifstream v1Stream(vector1);

Check failure

Code scanning / CodeQL

Uncontrolled data used in path expression

This argument to a file access function is derived from [user input (a command-line argument)](1) and then passed to std::basic_ifstream<char, char_traits<char>>::basic_ifstream(__s). This argument to a file access function is derived from [user input (a command-line argument)](1) and then passed to std::basic_ifstream<char, char_traits<char>>::basic_ifstream(__s), which calls std::basic_ifstream<char, char_traits<char>>::open(__s), which calls std::basic_filebuf<char, char_traits<char>>::open(__s). This argument to a file access function is derived from [user input (a command-line argument)](1) and then passed to std::basic_ifstream<char, char_traits<char>>::basic_ifstream(__s), which calls std::basic_ifstream<char, char_traits<char>>::open(__s).
std::ifstream v1_stream(vector1);
std::ifstream v2_stream(vector2);
std::ifstream v1Stream(vector1);
std::ifstream v2Stream(vector2);

Check failure

Code scanning / CodeQL

Uncontrolled data used in path expression

This argument to a file access function is derived from [user input (a command-line argument)](1) and then passed to std::basic_ifstream<char, char_traits<char>>::basic_ifstream(__s). This argument to a file access function is derived from [user input (a command-line argument)](1) and then passed to std::basic_ifstream<char, char_traits<char>>::basic_ifstream(__s), which calls std::basic_ifstream<char, char_traits<char>>::open(__s), which calls std::basic_filebuf<char, char_traits<char>>::open(__s). This argument to a file access function is derived from [user input (a command-line argument)](1) and then passed to std::basic_ifstream<char, char_traits<char>>::basic_ifstream(__s), which calls std::basic_ifstream<char, char_traits<char>>::open(__s).
const unsigned int stepNumber,
const std::string& approximationStrategy,
const std::int64_t seed,
Args&&... args) {

Check notice

Code scanning / CodeQL

Unused local variable

Variable args is not used.
@hillmich hillmich marked this pull request as ready for review March 3, 2023 08:31
@hillmich hillmich requested a review from burgholzer March 3, 2023 08:31
Copy link
Member

@burgholzer burgholzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many thanks for getting this into DDSIM.
The checks seem happy and so am I. Just a handful of comments/question which shouldn't be too hard to address.

include/DeterministicNoiseSimulator.hpp Outdated Show resolved Hide resolved
include/GroverSimulator.hpp Show resolved Hide resolved
include/Simulator.hpp Show resolved Hide resolved
include/StochasticNoiseSimulator.hpp Outdated Show resolved Hide resolved
- Use plain std::unique_ptr to store the quantum computation for the simulators
@hillmich hillmich requested a review from burgholzer March 7, 2023 13:49
@hillmich hillmich merged commit 753b4d3 into main Mar 8, 2023
@hillmich hillmich deleted the cpp-linter branch March 8, 2023 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Anything related to improvements of the existing library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants